"""用户领域模型（迁移自 app.models）"""

from typing import Optional
from enum import Enum

from sqlmodel import SQLModel, Field


class UserRole(str, Enum):
    """用户角色枚举"""

    admin = "admin"
    user = "user"


class User(SQLModel, table=True):
    """用户表"""

    id: Optional[int] = Field(default=None, primary_key=True)
    username: str = Field(index=True)
    full_name: Optional[str] = None
    hashed_password: str
    disabled: bool = Field(default=False)
    role: UserRole = Field(default=UserRole.user, index=True)


